﻿using System.Collections.Generic;
using NPersistence;

namespace EstimateTracker.Domain.Entities
{
    [Entity]
    [NamedQuery(Name = "FindByProjectId", Query = "FROM Activity a WHERE a.Project.Id = :Id")]
    public class Activity
    {
        [Id][GeneratedValue]
        public virtual int Id { get; set; }

        [Column]
        public virtual string Name { get; set; }

        [ManyToOne]
        [JoinColumn(Name = "Project_id")]
        public virtual Project Project { get; set; }

        [OneToMany(MappedBy = "Activity")]
        public virtual IList<Task> Tasks { get; set; }
    }
}